<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <titleType style="display: none;">czzyjf</titleType>
    <%- include('../../../_global/baseLibs') %>
    <link rel="stylesheet" href="/static/css/payment.css">
    <style type="text/css">
        .perList{
            border-top: 1px solid #ccc;
        }
    </style>
</head>
<body>
<!--设置头部信息-->
<header class="header-box fixed grey">
    <div class="header-content">
        <div class="left-tool">
            <a class="back" href="javascript:void(0);"><i class="iconfont icon-back"></i></a>
        </div>
        <div class="title">住院记录</div>
    </div>
</header>
<section id="searchResult" >
    <div id="hosrRecord">
        <div><ul class="bilsContent current">
                <li><span class="grayFont">当前住院记录</span></li>
            </ul>
        </div>
    </div>
    <div id="historyList">
        <div><ul class="bilsContent history">
                <li><span class="grayFont">历史住院记录</span></li>
            </ul>
        </div>
</section>

</body>

</html>
<script type="text/html" id="currentListTpl">
    {{each data}}
    <li class="payInfo">
        <div><span class="grayFont">入院时间:</span>  {{$value.b}}</div>
        <div><span  class="grayFont">出院时间:</span> {{$value.c}}</div></li>
    <li class="payInfo"><div><span class="grayFont">入院科室:</span>  {{$value.d}}</div>
        <div><span  class="grayFont">病区:</span> {{$value.e}}</div></li>
    <li><span class="grayFont">床位:</span> {{$value.f}}</li>
    <li class="payInfo"><div><span class="grayFont">主管医生:</span>  {{$value.g}}
        </div>
        <div><span  class="grayFont">主管护士:</span> {{$value.h}}</div></li>
    <li><span id="display{{$index}}">预缴全金额</span><button >充值</button>
    </li>
    {{/each}}
</script>
<script type="text/html" id="hostoryListTpl">
    {{each data}}
    <li class="payInfo">
        <div><span class="grayFont">入院时间:</span>  {{$value.b}}</div>
        <div><span  class="grayFont">出院时间:</span> {{$value.c}}</div></li>
    <li class="payInfo"><div><span class="grayFont">入院科室:</span>  {{$value.d}}</div>
        <div><span  class="grayFont">病区:</span> {{$value.e}}</div></li>
    <li><span class="grayFont">床位:</span> {{$value.f}}</li>
    <li class="payInfo"><div><span class="grayFont">主管医生:</span>  {{$value.g}}</div>
        <div><span  class="grayFont">主管护士:</span> {{$value.h}}</div></li>
    <li><span id="display{{$index}}">预缴全金额</span><button >缴纳明细</button>
    </li>
    {{/each}}
</script>
<script type="text/javascript">


   
  

    var page_zyjfResult = (function($, page_zyjfResult) {

        function getListData(){

            var arr =[
                {
                    b:"2018-01-05",
                    c:"2018-01-09",
                    d:"内科",
                    e:"A区",
                    f:"12",
                    g:"阿信宏",
                    h:"小王"
                }
            ];

            if(arr.length>0){
                var str = template("currentListTpl", {data:arr});

                $('.current').append(str);
            }

        }
        function historyList(){
            var arr =[
                {
                    b:"2018-01-05",
                    c:"2018-01-09",
                    d:"内科",
                    e:"A区",
                    f:"12",
                    g:"阿信宏",
                    h:"小王"
                }
            ];

            if(arr.length>0){
                var str = template("hostoryListTpl", {data:arr});
                $('.history').append(str);
            }

        }
        function recharge(){
            $.pageSwitch.goToUrl("treatmentPay","prePay")
        }

        function toList(){
            $.pageSwitch.goToUrl("treatmentPay","prePayList")
        }
        var cfg_def = {
            getListData: getListData,
            historyList: historyList,
            recharge: recharge,
            toList: toList,
        }

        page_zyjfResult.init = function(cfg){
            $.extend(page_zyjfResult, cfg_def, cfg);
            page_zyjfResult.getListData();
            page_zyjfResult.historyList();
            $('#currentListTpl button').click(page_zyjfResult.recharge)
            $('#hostoryListTpl button').click(page_zyjfResult.toList)

        }

        return page_zyjfResult;
    })(jQuery, {});
    
</script>